/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.emergency.plan.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.hopes.bizz.emergency.common.constant.enums.ParkEmergencySysDictEnum;
import com.hopes.boss.admin.api.entity.SysDictItem;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseEntity;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 企业应急预案
 *
 * @author cx
 * @date 2023-10-26 11:07:16
 */
@Data
@TableName(value = "er_emergency_plan")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "企业应急预案")
public class ErEmergencyPlanEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


	/**
	* 标识
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="标识")
    private Long id;

	/**
	* 预案类型
	*/
    @Schema(description="预案类型")
    private Integer planType;

	/**
	* 预案名称
	*/
    @Schema(description="预案名称")
    private String planName;

	/**
	* 备案编号
	*/
    @Schema(description="备案编号")
    private String filings;

	/**
	* 申请时间
	*/
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description="申请时间")
    private Date applyTime;

	/**
	* 到期时间
	*/
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description="到期时间")
    private Date dueTime;


	/**
	 * 过期状态
	 */
	@Schema(description="过期状态")
	private Integer overdueStatus;

	/**
	* 预案描述
	*/
    @Schema(description="预案描述")
    private String contentDesc;

	/**
	 * 预备内容
	 */
	@Schema(description="预备内容")
	private String prepareContent;
	/**
	 * 版本号
	 */

	@Schema(description="版本号")
	private String version;

	/**
	 * 备案日期
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Schema(description="备案日期")
	private Date filingDate;

	/**
	 * 编制单位
	 */
	@Schema(description="编制单位")
	private String compileUnit;

	/**
	 * 适用范围
	 */
	@Schema(description="适用范围")
	private String applyScope;

	/**
	 * 重大危险源标志
	 */
	@Schema(description="重大危险源标志")
	private Integer hazardFlag;

	/**
	 * 重大危险源
	 */
	@Schema(description="重大危险源")
	private String hazard;

	/**
	* 状态
	*/
    @Schema(description="状态")
    private Integer planState;

	/**
	 * 审核意见
	 */
	@Schema(description="审核意见")
	private String auditOpinion;

	/**
	* 机构ID
	*/
    @Schema(description="机构ID")
    private Long orgId;


	public String getOrgIdStr() {
		return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company,this.orgId);
	}

	public String getPlanTypeStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_plan_type, this.getPlanType());
	}

	public String getPlanStateStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_plan_status, this.getPlanState());
	}

	public String getCompileUnitStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_compilation_org, this.getCompileUnit());
	}

	public String getOverdueStatusStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_plan_overdue_status, this.getOverdueStatus());
	}

}